<?php
//============================================================+
// File name   : pononprepack.php
// Begin       : 2012-11-09
// Last Update : 2012-11-09
//
// Description : This is gen Po Pre Pack Layout to pdf file.
//               
//
// Author: Edo Wong
//
//============================================================+

/**
 * Creates Po Pre Pack Layout to pdf file using TCPDF
 * @package com.tecnick.tcpdf
 * @abstract  Po Pre Pack Layout 
 * @author Edo Wong
 * @since  2012-11-09
 */


require_once('tcpdf/config/lang/eng.php');
require_once('tcpdf/tcpdf.php');
date_default_timezone_set('Asia/Taipei');


// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {


	//Page header
	public function Header() {
		// Logo
		//$image_file = K_PATH_IMAGES.'logo_example.jpg';
		//$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
		// Set font
		$this->SetFont('helvetica', 'B', 12);
		// Title
       
        
        require('db_connector.php');
        //$connectDB = new mysql("localhost","root","asdfghjkl","edi_db_testsap","edidb","utf8");
		//$result = $connectDB->conditionfind("po_hdr","where po_no='4700002399'");
        //$result2 = $connectDB->fetch_row($result);
        $sql ="select * from po_hdr where po_no='4700002399' ";
        $result = mysql_query($sql);
        $result2 = mysql_fetch_row($result);
		$this->Cell(0, 10, $result2[50], 0, 1, 'C', 0, '', 0, false, 'M', 'M');
        
 		$this->SetFont('helvetica','I', 8);
		$this->Cell(0, 10, $result2[51].",".$result2[52].",".$result2[53].",".$result2[54], 0, 1, 'C', 0, '', 0, false, 'M', 'M');
		
        		// Position at 15 mm from bottom
		$this->SetY(15);
        $this->SetX(190);
		// Set font
		$this->SetFont('helvetica', '', 8);
		// Page number
		//$this->Cell(0, 15, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
		$this->Cell(0, 8, 'Page : '.$this->getAliasNumPage().' of '.$this->getAliasNbPages(), 0, 1, 'C', 0, '', 0, false, 'M', 'M');
        
        $this->SetX(130);
		$this->SetFont('helvetica','', 9);
		$this->Cell(0, 8, "Purchase Order No  :     ", 0, 1, 'C', 0, '', 0, false, 'M', 'M');
        $this->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
        $this->SetFillColor(255,255,255);
//$this->SetTextColor(0,0,255);
		$this->SetY(17);
        $this->SetX(177);
        $this->MultiCell(30, 4, $result2[2], 1, 'C', 1, 0);
        
		$this->SetY(25);
		$this->SetX(145);
        $this->SetFont('helvetica','', 9);
		$this->Cell(0, 10, "Revision No. :    ".$result2[4], 0, 1, 'C', 0, '', 0, false, 'M', 'M');
        if($result2[33] =="C"){
		$this->SetY(30);
		$this->SetX(130);
        $this->SetFont('helvetica','B', 12);
		$this->Cell(0, 10, "CANCELLED", 0, 1, 'C', 0, '', 0, false, 'M', 'M');  
        $this->SetTopMargin(36); 
        }
        
        else{
        $this->SetTopMargin(32);  
        }
        
	}
    
    
    	// Page footer
	public function Footer() {
	   
		// Position at 15 mm from bottom
		//$this->SetY(-15);
        $this->SetX(200);
		// Set font
		$this->SetFont('helvetica', 'I', 8);
		// Page number
		$this->Cell(0, 0, 'SAP ', 0, false, 'C', 0, '', 0, false, 'T', 'M');
        
	}

}

// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 003');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

// set font
$pdf->SetFont('times', '', 10);

// add a page
$pdf->AddPage();

//$connectDB2 = new mysql("localhost","root","asdfghjkl","edi_db_testsap","edidb","utf8");
//$result1 = $connectDB2->conditionfind("po_hdr","where po_no='4700002399'");
//$resultbody = $connectDB2->fetch_row($result1);
        $sql ="select * from po_hdr where po_no='4700002399' ";
        $resultbd = mysql_query($sql);
        $resultbody = mysql_fetch_row($resultbd);

// set some text to print

//$result[] = $connectDB->show_tables(edi_db_testsap);
//$poissue = date_format($resultbody[5], 'd F Y');
$poPrintDate = date('d-M-Y');
$poissue = new DateTime($resultbody[5]);
$poissuec = $poissue->format('d-M-Y');
$posendDate = new DateTime($resultbody[30]);
$posendDatec = $posendDate->format('d-M-Y');
$html2 = <<<EOD
<table width="750" height="300" border="0">
  <tr>
    <td width="16%">Vendor/Pay To :</td>
    <td width="30%">$resultbody[36]<br>$resultbody[17]<br>$resultbody[18] <br>$resultbody[37], $resultbody[38]<br>$resultbody[40] </td>
    <td colspan="2" rowspan="3" width="10%">&nbsp;</td>
    <td width="10%">Ship To :</td>
    <td width="40%">$resultbody[22]<br>$resultbody[23]<br>$resultbody[24]<br>$resultbody[45],&nbsp;$resultbody[46],&nbsp;$resultbody[47]<br>$resultbody[48]</td>
  </tr>
  <tr>
  <br>
    <td>Factory :</td>
    <td>$resultbody[19]<br>$resultbody[20]<br>$resultbody[21]<br>$resultbody[41],&nbsp;$resultbody[42]<br>$resultbody[44]</td>
    <td>Mark For :</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
   <br>
    <td>Bill To :</td>
    <td>$resultbody[56]<br>$resultbody[57]<br>$resultbody[58]<br>$resultbody[59],&nbsp;$resultbody[60],&nbsp;$resultbody[61]<br>$resultbody[62]</td>
    <td>Fiscal Rep :</td>
    <td>&nbsp;</td>
  </tr>
  <br>
  <tr>
    <td>Agent/MO :</td>
    <td colspan="5">$resultbody[78]</td>
  </tr>
  <br>
  <tr>
    <td width="16%">Puechase Group :</td>
    <td width="20%">$resultbody[10]</td>
    <td width="15%">Customer PO# :</td>
    <td width="15%"><b>N/A</b></td>
    <td width="15%">PO Print :</td>
    <td width="15%">$poPrintDate</td>
  </tr>
  <tr>
    <td width="16%">Order Type :</td>
    <td width="20%">$resultbody[14]</td>
    <td width="15%">Storage Location :</td>
    <td width="15%">$resultbody[72]</td>
    <td width="15%">PO Issue :</td>
    <td width="15%">$poissuec</td>
  </tr>
    <tr>
    <td width="16%">PO Group :</td>
    <td width="20%">$resultbody[13]</td>
    <td width="15%">Mfg Origin :</td>
    <td width="15%">$resultbody[44]</td>
    <td width="15%">PO Contact :</td>
    <td width="15%">$resultbody[12]</td>
  </tr>
    <tr>
    <td width="16%">Payment Category :</td>
    <td width="20%">$resultbody[77]</td>
    <td width="15%">Business Type :</td>
    <td width="15%">$resultbody[15]</td>
    <td width="15%">Date Sent :</td>
    <td width="15%">$posendDatec</td>
  </tr>
</table>


EOD;
// print a block of text using Write()
//$pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $html2, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);




// add a page
//require('mysql_connect.php');
//$connectDB3 = new mysql("localhost","root","asdfghjkl","edi_db_testsap","edidb","utf8");

//print_r($r);  
//echo 
//$texta = $r[1]['ItemLine_no'];

//$itemLineNoresults = $connectDB2->querystm("SELECT ItemLine_no FROM po_dtl WHERE `PO_No` = '4700002399' UNION SELECT ItemLine_no FROM `po_dtl` WHERE `PO_No` = '4700002399'");
  $sqlbd3 ="SELECT ItemLine_no FROM po_dtl WHERE `PO_No` = '4700002399' UNION SELECT ItemLine_no FROM `po_dtl` WHERE `PO_No` = '4700002399'";
    $itemLineNoresults = mysql_query($sqlbd3);
while ($row = mysql_fetch_array($itemLineNoresults)) {
$r[] = $row;

            //echo ;

}
$ordertotalamount = 0;
$ordertotalqty = 0;
$length = count($r);//???
for ( $i=0 ; $i<$length ; $i++ ) {
  //echo "index=".$i." ; value=".$r[$i]['ItemLine_no']."<br>";
   //}
//for($i=0;$i<4;$i++){
$itemlineno = $r[$i]['ItemLine_no'];

$sqlbdtetail3 ="SELECT * FROM `po_dtl` WHERE `PO_No` ='4700002399' AND `ItemLine_No` ='".$itemlineno. "' LIMIT 0 , 1";
$itemLineNoresultsinfoq = mysql_query($sqlbdtetail3);
$itemLineNoresultsinfo = mysql_fetch_row($itemLineNoresultsinfoq);





$contractualDDate = new DateTime($itemLineNoresultsinfo[48]);
$contractualDDatec = $contractualDDate->format('d-M-Y');

$handoverDate  = new DateTime($itemLineNoresultsinfo[70]);
$handoverDatec = $handoverDate->format('d-M-Y');


if($itemLineNoresultsinfo[69] =="A"){
    $shipmode1 = "AIR";    
}
else if($itemLineNoresultsinfo[69] =="S"){
    $shipmode1 = "OCEAN";    
}
else if($itemLineNoresultsinfo[69] =="E"){
    $shipmode1 = "LAND";
}

if($itemLineNoresultsinfo[59] =="CC"){
    $shipmode2 = "COLLECT";    
}
else if($itemLineNoresultsinfo[59] =="PP"){
    $shipmode2 = "PRE-PAID";    
}
else{
    $shipmode2 = "";
}


$centralPOno = $itemLineNoresultsinfo[68];
if($itemLineNoresultsinfo[68] ==""){
    $centralPOno = "<b>N/A</b>";
}

$customerHandoverPlace = $itemLineNoresultsinfo[66];
if($itemLineNoresultsinfo[66] ==""){
    $customerHandoverPlace = "<b>N/A</b>";
}

$pattern = $itemLineNoresultsinfo[28];
if($itemLineNoresultsinfo[28] ==""){
    $pattern = "<b>N/A</b>";
}

$fixture = $itemLineNoresultsinfo[42];
if($itemLineNoresultsinfo[42] ==""){
    $fixture = "<b>N/A</b>";
}

$rigIndicator = $itemLineNoresultsinfo[27];
if($itemLineNoresultsinfo[27] ==""){
    $rigIndicator = "<b>N/A</b>";
}




$html3 = <<<EOD

<p></p>
<table width="750" height="300" border="0">
  <tr>
      <td colspan="6" style="background-color:#FFFFAA;" width="39%">
Pre-pack Material#&nbsp;:$itemLineNoresultsinfo[5]
</td>
      <td colspan="2" style="background-color:#FFFFAA" width="43%">
Prepack UPC&nbsp;:$itemLineNoresultsinfo[63]
</td>
      <td colspan="2" style="background-color:#FFFFAA;" width="23%">
Total Packs&nbsp;:$itemLineNoresultsinfo[56]
</td>
  </tr>
  <tr>
    <td width="16%"><u>PO Item # $itemLineNoresultsinfo[4]</u></td>
    <td>&nbsp;</td>
    <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
    <td width="16%">Season :</td>
    <td width="15%">$itemLineNoresultsinfo[22]</td>
    <td width="13%">Incoterms :</td>
    <td width="20%">$itemLineNoresultsinfo[46]</td>
    <td width="19%">Contractual Delivery Date:</td>
    <td width="20%">$contractualDDatec</td>
  </tr>
  <tr>
    <td width="16%">Inbound Pkg :</td>
    <td width="15%">$itemLineNoresultsinfo[24]</td>
    <td width="13%">Incoterms Place :</td>
    <td width="20%">$itemLineNoresultsinfo[47]</td>
    <td width="19%">Handover Date :</td>
    <td width="20%">$handoverDatec</td>
  </tr>
  <tr>
    <td width="16%">Mfg Process :</td>
    <td width="15%">$itemLineNoresultsinfo[23]</td>
    <td width="13%">Harbor/Port :</td>
    <td width="20%">$itemLineNoresultsinfo[64]</td>
    <td width="19%">Customer Handover Place :</td>
    <td width="20%">$customerHandoverPlace</td>
  </tr>
  <tr>
  
    <td width="16%">Quality :</td>
    <td width="15%">$itemLineNoresultsinfo[26]</td>
    <td width="13%">Ship Mode :</td>
    <td width="20%">$shipmode1&nbsp;$shipmode2</td>
    <td width="19%">Shade :</td>
    <td width="20%">$itemLineNoresultsinfo[25]</td>
  </tr>
  <tr>
    <td width="16%">Central PO number :</td>
    <td width="15%">$centralPOno</td>
    <td width="13%">&nbsp;</td>
    <td width="20%">&nbsp;</td>
    <td width="19%">&nbsp;</td>
    <td width="20%">&nbsp;</td>
  </tr>
  </table>
      <p></p>


EOD;

$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $html3, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);


$htmlchinfo = <<<EOD
     <table>

  <tr>
      <td style="background-color:#FFFFAA;" width="750"><u>Pre-pack Child Information:</u></td>
  </tr>   
  </table>
  <table>

  <tr>
      <td style="background-color:#FFFFAA;" width="39%">Material Number&nbsp;:$itemLineNoresultsinfo[71]</td>
      <td style="background-color:#FFFFAA;" width="43%"></td>
      <td colspan="4" style="background-color:#FFFFAA;">&nbsp;</td>
  </tr>
  <tr>
    <td width="16%">Model :</td>
    <td width="18%">$itemLineNoresultsinfo[29]</td>
    <td width="15%">Product Type :</td>
    <td width="20%">$itemLineNoresultsinfo[39]</td>
    <td width="19%">Merch Division :</td>
    <td width="20%">$itemLineNoresultsinfo[36]</td>
  </tr>
  <tr>
    <td width="16%">Color Description :</td>
    <td width="18%">$itemLineNoresultsinfo[8]</td>
    <td width="15%">Class :</td>
    <td width="20%">$itemLineNoresultsinfo[45]</td>
    <td width="19%">Concept Short Desc :</td>
    <td width="20%">$itemLineNoresultsinfo[35]</td>
  </tr>
  <tr>
    <td width="16%">Fabric Content :</td>
    <td width="18%">$itemLineNoresultsinfo[33]</td>
    <td width="15%">Board :</td>
    <td width="20%">$itemLineNoresultsinfo[31]</td>
    <td width="19%">Fish &amp; Wildlife Ind :</td>
    <td width="20%">$itemLineNoresultsinfo[40]</td>
  </tr>
  <tr>
    <td width="16%">Pattern :</td>
    <td width="18%">$pattern</td>
    <td width="15%">Gender :</td>
    <td width="20%">$itemLineNoresultsinfo[37]</td>
    <td width="19%">Down Feather Ind :</td>
    <td width="20%">$itemLineNoresultsinfo[38]</td>
  </tr>
    <tr>
    <td width="16%">&nbsp;</td>
    <td width="18%">&nbsp;</td>
    <td width="15%">Fixture :</td>
    <td width="20%">$fixture</td>
    <td width="19%">Rig Indicator :</td>
    <td width="20%">$rigIndicator</td>
  </tr>
</table>

EOD;

$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $htmlchinfo, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);



$htmlselling1 = <<<EOD
<table width="720" height="138" border="0" style="border-top: solid 1px #000;">
  <tr>
    <td style="border-bottom: solid 1px #000;" align="center">Size</td>
    <td style="border-bottom: solid 1px #000;" align="center">UPC/EAN</td>
    <td style="border-bottom: solid 1px #000;" align="center">MSRP</td>
    <td style="border-bottom: solid 1px #000;" align="center">Customer<br /> Selling Price</td>
    <td style="border-bottom: solid 1px #000"; align="center">Price</td>
    <td style="border-bottom: solid 1px #000;" align="center">Pack Qty</td>
    <td style="border-bottom: solid 1px #000;" align="center">Extended Qty</td>
    <td style="border-bottom: solid 1px #000;" align="center">&nbsp;&nbsp;Amount</td>
  </tr>
</table>
EOD;

$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $htmlselling1, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);


$sqlstmselling ="SELECT * FROM `po_dtl` WHERE `PO_No` ='4700002399' AND `ItemLine_No` ='".$itemlineno. "'";
$sellresultsq = mysql_query($sqlstmselling);
//$sellresults = mysql_fetch_array($sellresultsq);

$polinetotalamount =0;
$polinetotalqty = 0;
while($sr = mysql_fetch_array($sellresultsq)){

//$sr[] = $sellrow;

            //echo ;
//}
//$lengths = count($sr);//???
//for ($z=0;$z<$lengths;$z++ ) {
$size = $sr['Size_CD'];
$upcnean = $sr['EAN_UPC_CD'];
$msrp = $sr['RetailPrice_1'];
$msrpcurrency = $sr['BcurrencyCD'];
$custsellprx = $sr['RetailPrice_2'];
$custsellcurr = $sr['BcurrencyCD'];
$prx = $sr['UnitPrice_3'];
//$prxcurr = $sr[$i]['ItemLine_no'];
$quantity = $sr['Qty'];
$qtyuom = $sr['QtyUOM'];

//$htmlsellingb = "htmlsellingb".$z;
$extenqty = $itemLineNoresultsinfo[56] * $quantity;
$amount = $prx * $extenqty;
$polinetotalamount += $amount;
$polinetotalqty += $extenqty;
$msrp =number_format($msrp, 2, '.', ',');
$custsellprx =number_format($custsellprx, 2, '.', ',');
$amount =number_format($amount, 2, '.', ',');
$prx =number_format($prx, 2, '.', ',');
//$extenqty =number_format($extenqty, 2, '.', ',');
$htmlsellingb = <<<EOD
<table width="750" height="138" border="0">
  <tr>
    <td align="center">$size</td>
    <td>$upcnean</td>
    <td>$msrp&nbsp;$msrpcurrency</td>
    <td>$custsellprx&nbsp;$custsellcurr </td>
    <td>$prx&nbsp;&nbsp;$resultbody[74]</td>
    <td width="8%" align="center">$quantity</td>
    <td width="10%" align="right">$extenqty&nbsp;&nbsp;$qtyuom </td>
    <td align="right" width="12.5%">$amount</td>
  </tr>
</table>
EOD;

$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $htmlsellingb, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);

}
$ordertotalamount += $polinetotalamount;
$ordertotalqty += $polinetotalqty;
$polinetotalqty = number_format($polinetotalqty);
$polinetotalamount = number_format($polinetotalamount, 2, '.', ',');
$htmlsellingc = <<<EOD
<table width="750" border="0" style="border-top: solid 1px #000;">
  <tr>
    <td width="50%">&nbsp;</td>
    <td style="border-bottom: solid 1px #000;" width="16%">PO Line Total</td>
    <td style="border-bottom: solid 1px #000;" align="right" width="16%">$polinetotalqty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td style="border-bottom: solid 1px #000;" align="right" width="16%">$polinetotalamount&nbsp;&nbsp;$resultbody[74]</td>
  </tr>
</table>
EOD;

$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $htmlsellingc, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);

}
$ordertotalqty = number_format($ordertotalqty);
$ordertotalamount = number_format($ordertotalamount, 2, '.', ',');
$htmlsellingd = <<<EOD

<table width="752" border="0">
  <tr>
    <td width="50%">&nbsp;</td>
    <td style="border-bottom: double 4px;" width="16%">Purchase Order Total</td>
    <td style="border-bottom: double 4px;" align="right" width="16%">$ordertotalqty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td style="border-bottom: double 4px;" align="right" width="15%">$ordertotalamount&nbsp;&nbsp;$resultbody[74]</td>
  </tr>
</table>
<p>&nbsp;</p>
<u>Order Remarks / Comments</u><br />
$resultbody[16]
<br />
<br />
<p align="right">
By Purchase Agent:<u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</p>
<p>&nbsp;</p>
<p><u>Terms And Condition:</u>
<p style="font-style: italic;font-size:8pt;">$resultbody[75]</p>
<p>***End of Purchase Order***</p>
</p>
EOD;
$pdf->writeHTMLCell($w=0, $h=0, $x='2', $y='', $htmlsellingd, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);

// ---------------------------------------------------------


//$tmp = ini_get('upload_tmp_dir');
$pdf->Output("example.pdf", "I");

//============================================================+
// END OF FILE                                                
//============================================================+
